import java.util.Scanner;

import static java.lang.Math.sqrt;

public class PrimeNumber {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入左范围");
        int left = sc.nextInt();
        System.out.println("请输入右范围");
        int right = sc.nextInt();
        for (int i = left; i <= right; i++) {
                boolean x = true;
                for (int j = 2; j <= sqrt(i); j++) {
                    if (i % j == 0) {
                        x = false;
                        break;
                    }
            }
                if(x){
                    System.out.println(i + "是质数");
                }else{
                    System.out.println(i + "不是质数");
                }

    }
}
}
